package page345;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        try {
            File file = new File("sourse.txt");
            Scanner scanner = new Scanner(file);
            scanner.useDelimiter("[^0123456789]+");
            int sum = 0, num = 0;
            while (scanner.hasNextInt()) {
                num++;
                int temp = scanner.nextInt();
                sum += temp;
            }
            System.out.println("平均价格是：" + sum * 1.0 / num);
        } catch (IOException e) {
            e.fillInStackTrace();
        }
    }
}
